package com.xcexample.electronicclasscard

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xcexample.electronicclasscard.main.HomeResponse


class WeekAdapter :
    BaseQuickAdapter<HomeResponse.Course.Weeks, BaseViewHolder>(R.layout.radio_button) {

    var select = 0
    override fun convert(helper: BaseViewHolder, item: HomeResponse.Course.Weeks) {
        helper.setText(R.id.tv_sun, item.week)
        var view = helper.getView<TextView>(R.id.tv_sun)
        if (helper.position == select) {
            view.setTextColor(context.resources.getColor(R.color.white))
            view.setBackgroundResource(R.drawable.shape_ff3f8cff)
        } else {
            view.setBackgroundResource(R.drawable.shape_f4f9fd)
            view.setTextColor(context.resources.getColor(R.color._0a1629))
        }
    }
}
